# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2022年01月03日
"""
from lxml import etree
html = """
<book>
	<id>1</id>
	<name>野花遍地⾹</name>
	<price>1.23</price>
	<nick>臭⾖腐</nick>
	<author>
		<nick id="10086">周⼤强</nick>
		<nick id="10010">周芷若</nick>
		<nick class="joy">周杰伦</nick>
		<nick class="jolin">蔡依林</nick>
		<div>
			<nick>惹了</nick>
		</div>
	</author>
	<partner>
		<nick id="ppc">胖胖陈</nick>
		<nick id="ppbc">胖胖不陈</nick>
	</partner>
</book>
"""
tree = etree.XML(html)
# result = tree.xpath('/book/name/text()')
# result = tree.xpath('/book/author/nick/text()')
# result = tree.xpath('/book/author//nick/text()')
result = tree.xpath('/book/author/*/nick/text()')

print(result)
